<!DOCTYPE html><html lang="cn" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><title>NoSQL篇-MongDB数据库 | 碧蓝幻想</title><meta name="author" content="阿尔托莉雅"><meta name="copyright" content="阿尔托莉雅"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="1.MongDB的简介： MongoDB是一个开源、高性能、无模式的文档型数据库 当初的设计就是用于简化开发和方便扩展，是NoSQL数据库产品中的一种。是最像关系型数据库（MySQL）的非关系型数据库。 它支持的数据结构非常松散，是一种类似于 JSON 的 格式叫BSON，所以它既可以存储比较复杂的数据类型，又相当的灵活。 MongoDB中的记录是一个文档，它是一个由字段和值对（fifield:v">
<meta property="og:type" content="article">
<meta property="og:title" content="NoSQL篇-MongDB数据库">
<meta property="og:url" content="http://example.com/2023/03/13/4.%E6%95%B0%E6%8D%AE%E5%BA%93/B3.NoSQL%E6%95%B0%E6%8D%AE%E5%BA%93%20-%20MongDB/index.html">
<meta property="og:site_name" content="碧蓝幻想">
<meta property="og:description" content="1.MongDB的简介： MongoDB是一个开源、高性能、无模式的文档型数据库 当初的设计就是用于简化开发和方便扩展，是NoSQL数据库产品中的一种。是最像关系型数据库（MySQL）的非关系型数据库。 它支持的数据结构非常松散，是一种类似于 JSON 的 格式叫BSON，所以它既可以存储比较复杂的数据类型，又相当的灵活。 MongoDB中的记录是一个文档，它是一个由字段和值对（fifield:v">
<meta property="og:locale">
<meta property="og:image" content="http://example.com/images/Otherwallpaper/avatar.png">
<meta property="article:published_time" content="2023-03-13T12:32:38.445Z">
<meta property="article:modified_time" content="2023-03-13T12:43:50.452Z">
<meta property="article:author" content="阿尔托莉雅">
<meta property="article:tag" content="MongDB NoSQL 数据库">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://example.com/images/Otherwallpaper/avatar.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://example.com/2023/03/13/4.%E6%95%B0%E6%8D%AE%E5%BA%93/B3.NoSQL%E6%95%B0%E6%8D%AE%E5%BA%93%20-%20MongDB/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'NoSQL篇-MongDB数据库',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-03-13 20:43:50'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/images/Otherwallpaper/avatar.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">11</div></a><a href="/tags/"><div class="headline">Tags</div><div class="length-num">4</div></a><a href="/categories/"><div class="headline">Categories</div><div class="length-num">2</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/archive/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 工具</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/images/"><i class="fa-fw fas fa-image"></i><span> 图库</span></a></li><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/video/"><i class="fa-fw fas fa-video"></i><span> 视频</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 链接</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/images/PCwallpaper/backgroud2.jpg')"><nav id="nav"><span id="blog-info"><a href="/" title="碧蓝幻想"><span class="site-name">碧蓝幻想</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/archive/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 工具</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/images/"><i class="fa-fw fas fa-image"></i><span> 图库</span></a></li><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/video/"><i class="fa-fw fas fa-video"></i><span> 视频</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 链接</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">NoSQL篇-MongDB数据库</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">Created</span><time class="post-meta-date-created" datetime="2023-03-13T12:32:38.445Z" title="Created 2023-03-13 20:32:38">2023-03-13</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2023-03-13T12:43:50.452Z" title="Updated 2023-03-13 20:43:50">2023-03-13</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="NoSQL篇-MongDB数据库"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">Post View:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="1-MongDB的简介："><a href="#1-MongDB的简介：" class="headerlink" title="1.MongDB的简介："></a>1.MongDB的简介：</h2><ul>
<li>MongoDB是一个开源、高性能、无模式的<strong>文档型数据库</strong></li>
<li>当初的设计就是用于简化开发和方便扩展，是<strong>NoSQL</strong>数据库产品中的一种。是<strong>最像关系型数据库（MySQL）的非关系型数据库</strong>。</li>
<li>它支持的数据结构非常松散，是一种类似于 JSON 的 格式叫BSON，所以它既可以存储比较复杂的数据类型，又相当的灵活。</li>
<li>MongoDB中的<strong>记录是一个文档</strong>，它是一个由<strong>字段和值对</strong>（fifield:value）组成的数据结构。MongoDB文档类似于JSON对象，即一个文档认为就是一个对象。字段的数据类型是字符型，它的值除了使用基本的一些类型外，还可以包括其他文档、普通数组和文档数组。</li>
</ul>
<h2 id="2-MongDB的相关概念："><a href="#2-MongDB的相关概念：" class="headerlink" title="2.MongDB的相关概念："></a>2.MongDB的相关概念：</h2><ul>
<li>MongoDB可应对三高需求：<ul>
<li>High performance - 对数据库高并发读写的需求</li>
<li>Huge Storage - 对海量数据的高效率存储和访问的需求</li>
<li>High Scalability &amp;&amp; High Availability- 对数据库的高可扩展性和高可用性的需求</li>
</ul>
</li>
</ul>
<h2 id="3-MongDB的体系结构："><a href="#3-MongDB的体系结构：" class="headerlink" title="3.MongDB的体系结构："></a>3.MongDB的体系结构：</h2><ul>
<li><p>mysql与MongDB对比</p>
<p><img src="C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20230223212212941.png" alt="image-20230223212212941"></p>
</li>
</ul>
<h2 id="4-MongDB的数据模型："><a href="#4-MongDB的数据模型：" class="headerlink" title="4.MongDB的数据模型："></a>4.MongDB的数据模型：</h2><ul>
<li><p>MongoDB的<strong>最小存储单位</strong>就是<strong>文档(document)对象</strong>。文档(document)对象对应于关系型数据库的行。数据在MongoDB中以</p>
<p>BSON（Binary-JSON）文档的格式存储在磁盘上。</p>
</li>
<li><p><strong>BSON</strong>（Binary Serialized Document Format）是一种<strong>类json的一种二进制形式的存储格式</strong>，简称Binary JSON。BSON和JSON一样，支持内嵌的文档对象和数组对象，但是BSON有JSON没有的一些数据类型，如Date和BinData类型。</p>
</li>
<li><p>BSON采用了类似于 C 语言结构体的名称、对表示方法，支持内嵌的文档对象和数组对象，具有<strong>轻量性、可遍历性、高效性</strong>的三个特点，可以有效描述非结构化数据和结构化数据。这种格式的优点是灵活性高，但它的缺点是空间利用率不是很理想。</p>
</li>
</ul>
<h2 id="5-MongDB的特点："><a href="#5-MongDB的特点：" class="headerlink" title="5.MongDB的特点："></a>5.MongDB的特点：</h2><ul>
<li>高性能：</li>
<li>高可用性：</li>
<li>高扩展性：</li>
<li>丰富的查询支持：</li>
</ul>
<h2 id="6-安装与配置："><a href="#6-安装与配置：" class="headerlink" title="6.安装与配置："></a>6.安装与配置：</h2><h3 id="1-yum安装："><a href="#1-yum安装：" class="headerlink" title="1.yum安装："></a>1.yum安装：</h3><ul>
<li><p>配置yum仓库：</p>
<img src="C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20230223204743691.png" alt="image-20230223204743691" style="zoom: 80%;" />

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[mongodb]</span><br><span class="line">name=mongo</span><br><span class="line">baseurl=https://mirrors.aliyun.com/mongodb/yum/redhat/8Server/mongodb-org/4.4/x86_64/</span><br><span class="line">gpgcheck=0</span><br></pre></td></tr></table></figure>
</li>
<li><p>安装：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install -y mongodb-org</span><br></pre></td></tr></table></figure>
</li>
<li><p>配置资源限制：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">配置资源限制</span></span><br><span class="line">[root@kittod ~]# vim /etc/security/limits.conf</span><br><span class="line">* soft nofile 65536</span><br><span class="line">* hard nofile 65536</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">默认情况下 MongoDB运行使用 mongod用户和下面的默认目录</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">这种安装方式将创建默认目录，并将这些目录的所有者和组设置为 mongod。</span></span><br><span class="line">[root@quruixiang yum.repos.d]# ll /var/lib/mongo/</span><br><span class="line">total 0</span><br><span class="line">[root@quruixiang yum.repos.d]# ll /var/log/mongodb</span><br><span class="line">total 0</span><br><span class="line">-rw-r----- 1 mongod mongod 0 Sep 29 05:53 mongod.log</span><br></pre></td></tr></table></figure>
</li>
<li><p>重启MongoDB：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl restart mongod</span><br></pre></td></tr></table></figure>
</li>
<li><p>连接MongoDB</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mongo --host=127.0.0.1 --port=27017</span><br></pre></td></tr></table></figure></li>
</ul>
<h3 id="2-docker安装："><a href="#2-docker安装：" class="headerlink" title="2.docker安装："></a>2.docker安装：</h3><ul>
<li><p>创建mongdb目录并打开它：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mkdir ~/mongdb &amp; cd ~/mongodb</span><br></pre></td></tr></table></figure>
</li>
<li><p>方式一：无账号密码，不需要认证的安装：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">docker run -d --name mongodb --restart always --privileged -p 27017:27017 \</span><br><span class="line">-v $PWD/data:/data/db mongo:4.2.2</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">参数：</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">--privileged 拥有真正的root权限</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">--restart=always Docker服务重启容器也启动</span></span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec -it mongodb /bin/bash</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mongo</span><br></pre></td></tr></table></figure>
</li>
<li><p>方式二：有账号密码，需要认证的安装：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">docker run -d --name mongodb --restart always --privileged -p 27017:27017 -v $PWD/data:/data/db \</span><br><span class="line">-e MONGO_INITDB_ROOT_USERNAME=admin \</span><br><span class="line">-e MONGO_INITDB_ROOT_PASSWORD=123456 \</span><br><span class="line">mongo:4.2.2 mongod --auth</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">参数：</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">-e MONGO_INITDB_ROOT_USERNAME=admin 指定用户名</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">-e MONGO_INITDB_ROOT_PASSWORD=123456 指定密码</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">mongod --auth ：容器默认启动命令是mongod,我们认证需要修改启动命为mongod --auth开启认证</span></span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec -it mongodb /bin/bash</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mongo --host=127.0.0.1 --port 27017 -u admin -p 123456 --authenticationDatabase admin</span><br></pre></td></tr></table></figure></li>
</ul>
<h2 id="7-数据库增删改查："><a href="#7-数据库增删改查：" class="headerlink" title="7.数据库增删改查："></a>7.数据库增删改查：</h2><ul>
<li><p>描述：</p>
<ul>
<li>一个 mongodb 中可以建立多个数据库。 MongoDB 的默认数据库为”db”</li>
<li>该数据库存储在 data 目录中</li>
<li>MongoDB 的单个实例可以容纳多个独立的数据库，每一个都有自己的集合和权限， 不同的数据库也放置在不同的文件中</li>
</ul>
</li>
<li><p>创建数据库和使用数据库：（新创建的数据库不会显示到数据库列表，除非数据库中有数据）</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">use [数据库名]</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">命名规范：</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">不能是空字符串（<span class="string">&quot;&quot;</span>)</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">不得含有<span class="string">&#x27; &#x27;</span>（空格)、.、$、/、\和\0 (空字符)</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">应全部小写</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">最多 64 字节</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">admin： 从权限的角度来看，这是<span class="string">&quot;root&quot;</span>数据库。要是将一个用户添加到这个 数据库，这个用户</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        自动继承所有数据库的权限。一些特定的服务器端命令也只 能从这个数据库运行，比如列出所有</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        的数据库或者关闭服务器</span> </span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash"><span class="built_in">local</span>: 这个数据永远不会被复制，可以用来存储限于本地单台服务器的任意集 合</span> </span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">config: 当 Mongo 用于分片设置时，config 数据库在内部使用，用于保存分片 的相关信息</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>查看所有数据库：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">show dbs</span><br></pre></td></tr></table></figure>
</li>
<li><p>查看当前正在使用的数据库：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">db</span><br></pre></td></tr></table></figure>
</li>
<li><p>删除数据库：（先使用数据库）</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">db.dropDatabase()</span><br></pre></td></tr></table></figure></li>
</ul>
<h2 id="8-集合（表）增删改查："><a href="#8-集合（表）增删改查：" class="headerlink" title="8.集合（表）增删改查："></a>8.集合（表）增删改查：</h2><ul>
<li><p>描述：</p>
<ul>
<li>文档是一组键值(key-value)对(即 BSON)</li>
<li>MongoDB 的文档不需要设置相同的字段， 并且相同的字段不需要相同的数据类型，这与关系型数据库有很大的区别</li>
</ul>
</li>
<li><p>创建集合：当向一个集合中插入一个文档的时候，如果集合不存在，则会自动创建集合</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.createCollection(name)</span><br><span class="line">例：</span><br><span class="line">db.createCollection(&quot;mycollection&quot;)</span><br></pre></td></tr></table></figure>
</li>
<li><p>查询当前库中的j集合：</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">show</span> collections</span><br></pre></td></tr></table></figure>
</li>
<li><p>集合的删除：</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.集合.<span class="keyword">drop</span>()</span><br><span class="line">例：</span><br><span class="line">db.book.drop()</span><br></pre></td></tr></table></figure></li>
</ul>
<h2 id="9-文档（行）增删改查："><a href="#9-文档（行）增删改查：" class="headerlink" title="9.文档（行）增删改查："></a>9.文档（行）增删改查：</h2><h3 id="1-新增数据："><a href="#1-新增数据：" class="headerlink" title="1.新增数据："></a>1.新增数据：</h3><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">db.集合名称.<span class="keyword">insert</span>(文档)</span><br><span class="line">db.集合名称.insertOne(文档)      # 向集合插入一个新文档</span><br><span class="line">db.集合名称.insertMany(文档)     # 向集合插入一个多个文档</span><br><span class="line">例：</span><br><span class="line">db.book.insertOne(&#123;name:&quot;springboot&quot;,type:&quot;springboot&quot;&#125;)</span><br><span class="line"># 参数：</span><br><span class="line"># document：要写入的文档。</span><br><span class="line"># writeConcern：写入策略，默认为 <span class="number">1</span>，即要求确认写操作，<span class="number">0</span> 是不要求。</span><br><span class="line"># ordered：指定是否按顺序写入，默认 <span class="literal">true</span>，按顺序写入。</span><br></pre></td></tr></table></figure>

<h3 id="2-修改数据："><a href="#2-修改数据：" class="headerlink" title="2.修改数据："></a>2.修改数据：</h3><ul>
<li><p>修改满足条件的一条数据：（遇到数据修改后结束）</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.集合名称.update(条件，&#123;操作种类:&#123;文档&#125;&#125;)</span><br><span class="line">例：</span><br><span class="line">db.book.update(&#123;name:&quot;springboot&quot;&#125;,&#123;$set:&#123;name:&quot;springboot2&quot;&#125;&#125;)</span><br></pre></td></tr></table></figure>
</li>
<li><p>修改满足条件的一条数据：（让数值加一）</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.集合名称.update(条件，&#123;操作种类:&#123;文档&#125;&#125;)</span><br><span class="line">例：</span><br><span class="line">db.book.update(&#123;name:&quot;spring&quot;&#125;,&#123;$inc:&#123;count:NumberInt(1)&#125;&#125;)</span><br></pre></td></tr></table></figure>
</li>
<li><p>修改满足条件的多条数据：</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.集合名称.<span class="keyword">update</span>(条件，&#123;操作种类:&#123;文档&#125;&#125;,&#123;multi:<span class="literal">true</span>&#125;)</span><br><span class="line">例：</span><br><span class="line">db.book.update(&#123;name:&quot;springboot&quot;&#125;,&#123;$<span class="keyword">set</span>:&#123;name:&quot;springboot2&quot;&#125;&#125;,&#123;multi:<span class="literal">true</span>&#125;)</span><br></pre></td></tr></table></figure></li>
</ul>
<h3 id="3-查看数据："><a href="#3-查看数据：" class="headerlink" title="3.查看数据："></a>3.查看数据：</h3><ul>
<li><p>基础查询：</p>
<ul>
<li><p>查询全部：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">db.集合.find(&#123;&#125;)</span><br></pre></td></tr></table></figure>
</li>
<li><p>查询第一条：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.集合.findOne(&#123;文档&#125;)</span><br><span class="line">例：</span><br><span class="line">db.book.findone(&#123;name:&quot;spring&quot;&#125;)</span><br></pre></td></tr></table></figure>
</li>
<li><p>查询指定数量文档：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">db.集合.find(&#123;文档&#125;).limit(10)</span><br></pre></td></tr></table></figure>
</li>
<li><p>跳过指定数量文档：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">db.集合.find(&#123;文档&#125;).skip(20)</span><br></pre></td></tr></table></figure>
</li>
<li><p>统计：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">db.集合.count()</span><br></pre></td></tr></table></figure>
</li>
<li><p>按条件排序：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.集合名称.find().sort(排序方式)</span><br><span class="line">例：</span><br><span class="line">db.comment.find().sort(&#123;userid:-1,likenum:1&#125;)</span><br></pre></td></tr></table></figure>
</li>
<li><p>投影：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">db.集合名称.find(条件,&#123;文档&#125;)</span><br></pre></td></tr></table></figure></li>
</ul>
</li>
<li><p>高级查询：</p>
<ul>
<li><p>模糊查询：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">db.集合.find(&#123;域名:/正则表达式/&#125;)</span><br><span class="line">例：</span><br><span class="line">db.comment.find(&#123;content:/开水/&#125;)  //包含“开水”的所有文档</span><br><span class="line">db.comment.find(&#123;content:/^专家/&#125;)  //以“专家”开头的的文档</span><br></pre></td></tr></table></figure>
</li>
<li><p>条件比较运算：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">db.集合.find(&#123;字段:&#123;关键词:值&#125;&#125;)</span><br><span class="line">关键词：</span><br><span class="line">大于：$gt </span><br><span class="line">小于： $lt</span><br><span class="line">大于等于： $gte</span><br><span class="line">小于等于： $lte</span><br><span class="line">不等于：$ne</span><br><span class="line">例：</span><br><span class="line">db.comment.find(&#123;likenum:&#123;$gt:NumberInt(700)&#125;&#125;)</span><br></pre></td></tr></table></figure>
</li>
<li><p>比较连接查询：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">db.集合.find(连接词:[&#123;字段:&#123;关键词:值&#125;&#125;,&#123;...&#125;])</span><br><span class="line">连接词：</span><br><span class="line">和：$and</span><br><span class="line">或：$or</span><br><span class="line">例：</span><br><span class="line">db.comment.find(&#123;$and:[&#123;likenum:&#123;$gte:NumberInt(700)&#125;&#125;,&#123;likenum:&#123;$lt:NumberInt(2000)&#125;&#125;]&#125;)  //大于等于700 并且小于2000的文档</span><br><span class="line">db.comment.find(&#123;$or:[ &#123;userid:&quot;1003&quot;&#125; ,&#123;likenum:&#123;$lt:1000&#125; &#125;]&#125;)  //userid为1003，或者点赞数小于1000的文档</span><br></pre></td></tr></table></figure>
</li>
<li><p>包含查询：（等同于SQL中的in）</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">db.集合.find(&#123;域名:&#123;关键词:[值1，值2]&#125;&#125;)</span><br><span class="line">关键词：</span><br><span class="line">包含：$in</span><br><span class="line">不包含：$nin</span><br><span class="line">例：</span><br><span class="line">db.comment.find(&#123;userid:&#123;$in:[&quot;1003&quot;,&quot;1004&quot;]&#125;&#125;)   //字段包含1003或1004的文档</span><br><span class="line">db.comment.find(&#123;userid:&#123;$nin:[&quot;1003&quot;,&quot;1004&quot;]&#125;&#125;)  //不包含1003和1004的文档</span><br></pre></td></tr></table></figure></li>
</ul>
</li>
</ul>
<h3 id="4-删除数据："><a href="#4-删除数据：" class="headerlink" title="4.删除数据："></a>4.删除数据：</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.集合名称.remove(条件)</span><br><span class="line">例：</span><br><span class="line">db.book.remove(&#123;type:&quot;springboot&quot;&#125;)</span><br></pre></td></tr></table></figure>



<h2 id="10-索引操作："><a href="#10-索引操作：" class="headerlink" title="10.索引操作："></a>10.索引操作：</h2><ul>
<li><p>索引的查看：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.collection.getIndexes()</span><br><span class="line">例：</span><br><span class="line"></span><br></pre></td></tr></table></figure>
</li>
<li><p>索引的创建：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">db.collection.createIndex(keys, options)</span><br><span class="line">例：</span><br><span class="line"></span><br></pre></td></tr></table></figure>
</li>
<li><p>索引的移除：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">  </span><br></pre></td></tr></table></figure></li>
</ul>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">Author: </span><span class="post-copyright-info"><a href="http://example.com">阿尔托莉雅</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">Link: </span><span class="post-copyright-info"><a href="http://example.com/2023/03/13/4.%E6%95%B0%E6%8D%AE%E5%BA%93/B3.NoSQL%E6%95%B0%E6%8D%AE%E5%BA%93%20-%20MongDB/">http://example.com/2023/03/13/4.%E6%95%B0%E6%8D%AE%E5%BA%93/B3.NoSQL%E6%95%B0%E6%8D%AE%E5%BA%93%20-%20MongDB/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">Copyright Notice: </span><span class="post-copyright-info">All articles in this blog are licensed under <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> unless stating additionally.</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/MongDB-NoSQL-%E6%95%B0%E6%8D%AE%E5%BA%93/">MongDB NoSQL 数据库</a></div><div class="post_share"><div class="social-share" data-image="/images/Otherwallpaper/avatar.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="next-post pull-full"><a href="/2023/03/13/4.%E6%95%B0%E6%8D%AE%E5%BA%93/B2.NoSQL%E6%95%B0%E6%8D%AE%E5%BA%93%20-%20Redis/" title="NoSQL篇-Redis数据库"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">Next Post</div><div class="next_info">NoSQL篇-Redis数据库</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/images/Otherwallpaper/avatar.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">阿尔托莉雅</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">11</div></a><a href="/tags/"><div class="headline">Tags</div><div class="length-num">4</div></a><a href="/categories/"><div class="headline">Categories</div><div class="length-num">2</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://toscode.gitee.com/blue-fantasy" target="_blank" title="Gitee"><i class="fab fa-github"></i></a><a class="social-icon" href="/1095322098@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>Announcement</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>Catalog</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-MongDB%E7%9A%84%E7%AE%80%E4%BB%8B%EF%BC%9A"><span class="toc-number">1.</span> <span class="toc-text">1.MongDB的简介：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-MongDB%E7%9A%84%E7%9B%B8%E5%85%B3%E6%A6%82%E5%BF%B5%EF%BC%9A"><span class="toc-number">2.</span> <span class="toc-text">2.MongDB的相关概念：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-MongDB%E7%9A%84%E4%BD%93%E7%B3%BB%E7%BB%93%E6%9E%84%EF%BC%9A"><span class="toc-number">3.</span> <span class="toc-text">3.MongDB的体系结构：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-MongDB%E7%9A%84%E6%95%B0%E6%8D%AE%E6%A8%A1%E5%9E%8B%EF%BC%9A"><span class="toc-number">4.</span> <span class="toc-text">4.MongDB的数据模型：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-MongDB%E7%9A%84%E7%89%B9%E7%82%B9%EF%BC%9A"><span class="toc-number">5.</span> <span class="toc-text">5.MongDB的特点：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#6-%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE%EF%BC%9A"><span class="toc-number">6.</span> <span class="toc-text">6.安装与配置：</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-yum%E5%AE%89%E8%A3%85%EF%BC%9A"><span class="toc-number">6.1.</span> <span class="toc-text">1.yum安装：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-docker%E5%AE%89%E8%A3%85%EF%BC%9A"><span class="toc-number">6.2.</span> <span class="toc-text">2.docker安装：</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#7-%E6%95%B0%E6%8D%AE%E5%BA%93%E5%A2%9E%E5%88%A0%E6%94%B9%E6%9F%A5%EF%BC%9A"><span class="toc-number">7.</span> <span class="toc-text">7.数据库增删改查：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#8-%E9%9B%86%E5%90%88%EF%BC%88%E8%A1%A8%EF%BC%89%E5%A2%9E%E5%88%A0%E6%94%B9%E6%9F%A5%EF%BC%9A"><span class="toc-number">8.</span> <span class="toc-text">8.集合（表）增删改查：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#9-%E6%96%87%E6%A1%A3%EF%BC%88%E8%A1%8C%EF%BC%89%E5%A2%9E%E5%88%A0%E6%94%B9%E6%9F%A5%EF%BC%9A"><span class="toc-number">9.</span> <span class="toc-text">9.文档（行）增删改查：</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E6%96%B0%E5%A2%9E%E6%95%B0%E6%8D%AE%EF%BC%9A"><span class="toc-number">9.1.</span> <span class="toc-text">1.新增数据：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E4%BF%AE%E6%94%B9%E6%95%B0%E6%8D%AE%EF%BC%9A"><span class="toc-number">9.2.</span> <span class="toc-text">2.修改数据：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-%E6%9F%A5%E7%9C%8B%E6%95%B0%E6%8D%AE%EF%BC%9A"><span class="toc-number">9.3.</span> <span class="toc-text">3.查看数据：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-%E5%88%A0%E9%99%A4%E6%95%B0%E6%8D%AE%EF%BC%9A"><span class="toc-number">9.4.</span> <span class="toc-text">4.删除数据：</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#10-%E7%B4%A2%E5%BC%95%E6%93%8D%E4%BD%9C%EF%BC%9A"><span class="toc-number">10.</span> <span class="toc-text">10.索引操作：</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>Recent Post</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/03/13/4.%E6%95%B0%E6%8D%AE%E5%BA%93/B3.NoSQL%E6%95%B0%E6%8D%AE%E5%BA%93%20-%20MongDB/" title="NoSQL篇-MongDB数据库">NoSQL篇-MongDB数据库</a><time datetime="2023-03-13T12:32:38.445Z" title="Created 2023-03-13 20:32:38">2023-03-13</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/03/13/4.%E6%95%B0%E6%8D%AE%E5%BA%93/B2.NoSQL%E6%95%B0%E6%8D%AE%E5%BA%93%20-%20Redis/" title="NoSQL篇-Redis数据库">NoSQL篇-Redis数据库</a><time datetime="2023-03-13T12:32:38.441Z" title="Created 2023-03-13 20:32:38">2023-03-13</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/03/13/4.%E6%95%B0%E6%8D%AE%E5%BA%93/A1.MySQL-%E6%AC%A7%E9%B9%8F%E7%AF%87/" title="SQL篇-MySQL数据库">SQL篇-MySQL数据库</a><time datetime="2023-03-13T12:32:38.437Z" title="Created 2023-03-13 20:32:38">2023-03-13</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/03/13/3.linux/D2.Ansible%E5%89%A7%E6%9C%AC/" title="Ansible">Ansible</a><time datetime="2023-03-13T12:32:23.866Z" title="Created 2023-03-13 20:32:23">2023-03-13</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/03/13/3.linux/D1.Ansible%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4%E5%B7%A5%E5%85%B7/" title="Ansible基础">Ansible基础</a><time datetime="2023-03-13T12:32:23.861Z" title="Created 2023-03-13 20:32:23">2023-03-13</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By 阿尔托莉雅</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="Read Mode"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="Toggle Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="Table Of Contents"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="Back To Top"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>